Release 10.1A: OpenEdge Reporting:
Query/Results for Windows


Details to create a query

You can create a query with the available database data that you want to examine.

To create a query:

Note: The steps for selecting the display fields do not apply to the Label view. See Chapter 4, "Using Query Views," for instructions on creating queries for the Label view.

  1. Choose Query New and a view for the query. The Add/Remove Tables dialog box appears:
  2. The Available Tables selection list shows the tables that comprise the database that you are connected to. If you are connected to more than one database, Results indicates the database in which each table resides.

  3. Select a table from the Available Tables selection list, then choose Add. The table appears in the Selected Tables selection list. The Available Tables selection list now displays only tables that have a relationship with the table you selected:
  4. Repeat Step 2 to add more tables, as necessary.
  5. After you add tables, the Selected Tables selection list displays the relationships, or joins, among the tables in the query. For example, if you select the Customer, Order, and Order-Line tables, the Selected Tables selection list appears as follows:

  6. When you are done adding tables, choose OK. The Add/Remove Fields dialog box appears:
  7. The Available Fields selection list displays all the fields in the tables you selected. If you are connected to more than one database, Results indicates the database where each field in the list resides.

  8. Select one or more fields from the Available Fields selection list, then choose Add:
  9. To select multiple fields, press CTRL and click individual fields, or press SHIFT and drag the mouse to select a range of fields. The fields are displayed in the Selected Fields selection list in the order in which they will be displayed in the view (from left to right).

  10. To reorder the display fields, select a field and choose Move Up or Move Down. Repeat this process until the fields are listed in the order in which you want them to appear in the view.
  11. Choose OK to display the query in the Progress Results window.

The appearance of the query depends on the type of view you chose in Step 1. The following query illustrates the Browse view. See Chapter 4, "Using Query Views," for more information about changing and using query views:

The status bar identifies the query view you are using and the database to which you are connected. If you are connected to more than one database, the status bar lists the first database to which you connected.

Each record in the view contains the information from the display fields you selected for the query. In this example, the records are composite records because they contain fields from more than one table. The data is displayed from left to right in the order you specified when you created the query.

The customer Lift Line Skiing appears several times because of the type of relationships between the tables. Each customer can have one or more orders, thus the relationship between the Customer and Order tables is a one-to-many relationship. Each order can have several line items, so the Order and Order-Line tables also have a one-to-many relationship. Results displays a composite record for each line item a customer orders.

For more information about relationships, see Chapter 1, " Results Overview."


Copyright © 2005 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095